package lab03.test09;

import java.io.*;

/**
 * Created by Administrator on 2017/12/14.
 */
public class Test01 {
    public static void main(String[] args)throws IOException {
        Test a1=new Test("1001","Java程序设计","第2版",56.9,560);
        Test a2=new Test("1002","Java开发实战","第1版",98.9,820);
        Test a3=new Test("1003","C++程序设计指南","第3版",62.5,362);
        Test a4=new Test("1004","EJB3.0入门经典","第1版",59.8,1280);
        Test a5=new Test("1005","Spring3.0 in Action","第3版",95.8,1189);
        Test test[]={a1,a2,a3,a4,a5};
        String a="编号\t名称\t\t版本\t价格\t销售额\r\n";
            for(int i=0;i<test.length;i++){
                a=a+test[i]+"\r\n";
            }
        File file=new File("e"+File.separator+"book.txt");

        Writer out=null;

        out=new FileWriter(file);

        out.write(a);

        out.close();


    }
}
